package com.itheima.extendsTest;

/**
 * this 是局部变量，就近原则，层层往外找
 **/
public class hashiqi_dog extends dog {
    private String name;
    private int age;
    private String like;

    public hashiqi_dog() {
        this(null,20,"喝酒");   // new hashiqi_dog() 时立刻执行这里进行初始化赋值.
    }

    public hashiqi_dog(String name, int age, String like) {
        this.name = name;
        this.age = age;
        this.like = like;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getLike() {
        return like;
    }

    public void setLike(String like) {
        this.like = like;
    }

    public void pohuaiHome() {
        System.out.println("拆家！");
    }
}


